<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/common.css" type="text/css" />
<script language="javascript" src="js/jquery-1.4.2.min.js"></script>
<script language="javascript" src="js/jquery.checkboxes.min.js"></script>
<script language="javascript" src="js/tableRowCheckboxToggle.js"></script>
<script>
$(document).ready(function(){
		//点击事件切换 全选取消状态
		$("#selectall").click( function (){ $("#grouplist").toggleCheckboxes(); });
	});
</script>

<title>列表</title>
</head>

<body>
<div id="man_zone">
<?php if($action=="edit"){?>
<form action="?action=edit" method="post" enctype="multipart/form-data">
<input name="gid" type="hidden" id="gid" value="<?php echo $gid;?>" />
<table width="99%" border="0" align="center"  cellpadding="3" cellspacing="1" class="table_style">
    <tr>
      <td width="15%" align="right" class="left_title_1">用户ID：</td>
      <td width="85%"><input name="uid" type="text" id="uid" value="<?php echo $value['uid']?>"  readonly="true"/></td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">用户名：</td>
      <td><input name="uname" type="text" id="uname" value="<?php echo $value['uname']?>" readonly="true"/></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td align="right" class="left_title_2">Email：</td>
      <td><input name="email" type="text" id="email" value="<?php echo $value['email']?>"   /></td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">密码：</td>
      <td><input name="oldpassword" type="hidden" id="oldpassword" value="<?php echo $value['pwd']?>"  /><input name="pwd" type="text" id="pwd" value=""  /></td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">QQ：</td>
      <td><input name="qq" type="text" id="qq" value="<?php echo $value['qq']?>"></td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">联系电话：</td>
      <td><input name="tel" type="text" id="tel" value="<?php echo $value['tel']?>"></td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">地址：</td>
      <td><input name="address" type="text" id="address" value="<?php echo $value['address']?>"></td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">邮编：</td>
      <td><input name="zip" type="text" id="zip" value="<?php echo $value['zip']?>"></td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">积分：</td>
      <td><input name="score" type="text" id="score" value="<?php echo $value['score']?>"></td>
    </tr>
    <tr>
      <td align="right" class="left_title_2">账户余额：</td>
      <td>
	  <input name="oldmoney" type="hidden" value="<?php echo $value['money']?>" />
	  $<input name="money" type="text" id="money" value="<?php echo $value['money']?>" style="background-color: red;color:#FFF"  /></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td align="right" class="left_title_2">&nbsp;</td>
      <td><input type="submit" name="Submit" value="提交" />
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="reset" name="Submit2" value="重置" /></td>
    </tr>
  </table>

  </form>
  
  <?php }elseif(empty($action)){?>
  
  <table width="99%" border="0" align="center" cellpadding="0" cellspacing="1">
    <tr>
      <td width="37%">
	    
    <input type="button" onclick="grouplist.submit();" name="Submit" value="删除选定" />
    <input type="button" onclick="location.href='user_add.php'" name="Submit4" value="添加用户" />
	<a href="user_list.php?action=downxls">【下载EXCEL表格格式】</a>
	</td>
      <td width="63%" align="right">
      	<form id="seach" name="seach" method="get" action="">
         &nbsp;会员ID：
            <input name="uid" type="text" id="uid" size="5" />
         &nbsp;email：
            <input name="email" type="text" id="email" size="20" />
         &nbsp;会员名称：
            <input name="uname" type="text" id="uname" size="15" />
          &nbsp;
            <input type="submit" name="Submit3" value="搜索" />
      	</form>
      </td>
    </tr>
  </table>
<form method="post" action="?action=dels" name="grouplist" id="grouplist">
  <table width="99%" align="center"  border="0" cellpadding="3" cellspacing="1" class="table_style">
    <tr>
      <th width="2%"><label>
        <input type="checkbox" name="checkbox" value="checkbox" id="selectall" />
      </label></th>
      <th width="5%">会员ID</th>
      <th width="15%">会员名称</th>
      <th width="15%">email</th>
      <th width="12%">tel</th>
      <th width="13%">注册时间</th>
      <th width="7%">用户积分</th>
      <th width="7%">团购次数</th>
      <th width="12%">最后登录</th>
      <th width="12%">操作</th>
    </tr>
	<?php if(is_array($dataarray)){foreach($dataarray as $value){?>
    <tr class="odd_row">
      <td align="center"><input type="checkbox" name="delids[]" value="<?php echo $value['uid']?>" /></td>
      <td><?php echo $value['uid']?></td>
      <td><?php echo $value['uname']?></td>
      <td><?php echo $value['email']?></td>
      <td><?php echo $value['tel']?></td>
      <td><?php if($value['addtime']!=0)echo date('Y-m-d H:i',$value['addtime'])?>&nbsp;&nbsp;</td>
      <td><?php echo $value['score']?></td>
      <td><?php echo $value['groupcount']?></td>
      <td><?php if($value['lastlogin']!=0)echo date('Y-m-d H:i',$value['lastlogin'])?></td>
      <td>
<a href="user_list.php?action=edit&amp;uid=<?php echo $value['uid']?>">编辑用户 </a>|<a href="javascript:if(confirm('确实要删除吗?'))location='user_list.php?action=del&uid=<?php echo $value['uid']?>'"> 删除</a></td>
    </tr>
	<?php }}else{?>
	<tr><td colspan=10>暂无数据..............</td></tr>
	<?php };?>
  </table>
  

  <div style="width:99%;margin:0px auto;">

  
    <?php echo multi($total,$pagesize,$page,"");?>
  </div>
  </form>
  <?php }?>
</div>
</body>
</html>
